package written.w20240918lixiang.q1;

/**
 * Main
 *
 * @Author : Ruoyu Wang
 * @DateTime : 2024/9/18 09:42
 */

import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        double p = in.nextDouble();
        double[] a = new double[n];
        for (int i = 0; i < n; i++) {
            a[i] = in.nextDouble();
        }
        double res = 0;
        double nowP = 1;
        for (int i = 0; i < n; i++) {
            res += nowP;
            double tmp = a[i] * p;
            nowP = nowP * (1 - tmp);
        }
        System.out.println(res);
    }
}
